#include<iostream>

using namespace std;

int A[100];

int Partition(int low, int high)
{
	int pivot = A[low];
	while (low < high)
	{
		while (low < high && A[high] >= pivot) --high;
		A[low] = A[high];
		while (low < high && A[low] <= pivot) ++low;
		A[high] = A[low];
	}
	A[low] = pivot;
	return low;
}


void QuickSort(int low, int high)
{
	if (low < high)
	{
		int pivotpos = Partition(low, high);
		QuickSort(low, pivotpos - 1);
		QuickSort(pivotpos + 1, high);
	}
}


int main()
{
	int N, final[100];
	cin >> N;
	for (int i = 0; i < N; i++)
	{
		cin >> A[i];
	}
	QuickSort(0, N - 1);
	int j = 0;
	for (int i = 0; i < N; i++)
	{
		if (i == 0 || A[i] != A[i - 1]) 
		{
			final[j] = A[i];
			j++;
		}
	}
	cout << j << endl;
	for (int i = 0; i < j; i++)
	{
		cout << final[i] << " ";
	}
	return 0;
}